/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hecatone;
import java.util.*;
import java.io.*;
import org.apache.log4j.Logger;
import org.apache.log4j.Priority;
import org.apache.log4j.PropertyConfigurator;
/**
 *
 * @author fredericpaquette
 */
public class GameMessageBundle {
    
    public Hashtable messages;
    private static final Logger logger = Logger.getLogger(GameMessageBundle.class);
    
    GameMessageBundle(){
        PropertyConfigurator.configure("log4j.properties");
        messages = loadProperties();
        logger.debug("Game messages loaded");
    }
    public String getMsg (String key)
    {
        String mes = (String)messages.get(key);
        return mes;
    }
    
    
    
      public Properties loadProperties ()
    {
        Properties prop = new Properties();
        try
            {

                prop.load(new FileInputStream(new File("gamemessages.properties")));
            }
                    catch(FileNotFoundException fne)
                {
                    logger.error(fne.getMessage());    }
                    catch(IOException io)
                    {
                        logger.error(io.getMessage());
                        logger.debug(io.getStackTrace());
                        System.exit(1);
                    }

        return prop;
      }
}
